<template>
  <div class="container">
    <!-- 顶部框模块 -->
    <div class="form-group">
      <div class="input-group">
        <slot name="title">
          <h4>品牌管理</h4>
        </slot>
      </div>
    </div>

    <!-- 数据表格 -->
    <table class="table table-bordered table-hover mt-2">
      <thead>
        <slot name="tableheader">
          <tr>
            <th>编号</th>
            <th>资产名称</th>
            <th>价格</th>
            <th>创建时间</th>
            <th>操作</th>
          </tr>
        </slot>
      </thead>
      <tbody>
        <tr v-for="(item, index) in list" :key="item.id">
          <td>
            <slot name="index" :index="index">{{ index }}</slot>
          </td>

          <td>
            <slot name="goodsname" :goodname="item.name">
              {{ item.name }}
            </slot>
          </td>

          <td >
            <slot name="goodsprice" :goodprice="item.price">
              ￥{{ item.price }}
            </slot>
          </td>
          <td>
            <slot name="goodstime" :goodtime="item.time">
              {{ item.time }}
            </slot>
          </td>
          <td>
            <slot name="goodsbtn">
              <a href="#">删除</a>
            </slot>
          </td>
        </tr>
      </tbody>

      <tfoot v-show="!list.length">
        <tr>
          <td colspan="5" style="text-align: center">
            <slot name="tablefoot">
              暂无数据
            </slot>
          </td>
        </tr>
      </tfoot>
    </table>
  </div>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      require: true
    }
  },
  data () {
    return {}
  },

  created () {},

  methods: {}
}
</script>

<style scoped lang="less"></style>
